package com.asl.website.serviceDetails.domain;

/**
 * @author 482944566@qq.com
 * @version 1.0
 * @date 2025-05-21
 */

import com.asl.website.common.Language;

/**
 * 运输服务详情响应DTO
 */
public class TransportServiceDTO {
    private Long id;
    private String title;
    private String subtitle;
    private String language;

    // 构造方法
    public TransportServiceDTO(TTransportService service, String language) {
        this.id = service.getId();
        this.language = language;

        switch (Language.fromCode(language)) {
            case EN_US:
                this.title = service.getServiceTitleEn();
                this.subtitle = service.getServiceSubtitleEn();
                break;
            case DE_DE:
                this.title = service.getServiceTitleDe();
                this.subtitle = service.getServiceSubtitleDe();
                break;
            default: // 默认中文
                this.title = service.getServiceTitleZh();
                this.subtitle = service.getServiceSubtitleZh();
        }
    }

    // getters
    public Long getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public String getLanguage() {
        return language;
    }
}